package web_package;

import db.User;
import db.File;
import db.Folder;
import java.util.LinkedList;

/**
 * mediates between the jsp file that are written mainly in java, to the rest of the project.
 */
public class ScalaCaller {
	
	public static User signNewUser(User usr){
		return WebInterface.signNewUser(usr);
	}
	
	public static User login(String email, String password){
		return WebInterface.login(email, password);
	}
	
	public static LinkedList<Folder> getFolders(Long userID, Long folderID){
		LinkedList<Folder> folders = new LinkedList<Folder>();
		Folder fold = new Folder();
		fold.setFolderName("folder1");
		fold.setFolderID(new Long(1));
		folders.add(fold);
		fold = new Folder();
		fold.setFolderName("folder2");
		fold.setFolderID(new Long(2));
		folders.add(fold);
		return folders;
	}
	
	public static LinkedList<File> getFiles(Long userID, Long folderID){
		LinkedList<File> files = new LinkedList<File>();
		File file = new File();
		file.setFileName("file1");
		files.add(file);
		file = new File();
		file.setFileName("file2");
		files.add(file);
		return files;
	}
}
